using System;
using System.Windows.Controls;

namespace Bazookabird.Wpf.Framework
{
    public class ContextMenuItem : MenuItem
    {
        private readonly Action _actionToPerform;

        public ContextMenuItem(Action actionToPerform)
        {
            _actionToPerform = actionToPerform;
        }

        protected override void OnClick()
        {
            base.OnClick();
            _actionToPerform.Invoke();
        }
    }
}